/**
 * Created with Intellij IDEA.
 * Description
 * User: wen
 * Date:2022-02-12
 * TIME:10:17
 * psvm 回车  <==>  public static void main(String[] args)
 * sout 打印
 */
public class TestDemo {

    public static void main(String[] args) {
        byte a = 1;
        byte b = 2;
        //byte c = a + b;//err
        byte c = (byte)(a + b);
        System.out.println(c);
        byte c2 = 1+2;//byte c2 = 3;

        int i1 = 10;
        long l1 = 20;
        //int i2 = i1 + l1;//err
        int i2 = (int)(i1 + l1);
    }

    public static void main5(String[] args) {
        int a = 10;
        long b = 20;
        b = a;
        //a = b;
    }

    public static void main4(String[] args) {
        final int SIZE = 2;
        System.out.println(SIZE);
    }
    public static void main3(String[] args) {
        System.out.println("\"bit\"");//"bit"
        System.out.println("\\bit\\");//  \bit\
        System.out.println("\\\\bit\\\\");// \bit\
    }
    public static void main2(String[] args) {
        System.out.println("hello"+"world");//helloworld
        System.out.println("hello"+10+20);//hello1020
        System.out.println(10+20+"hello");//30hello
        System.out.println("hello"+(10+20));//hello30
        System.out.println(10+""+20+"hello");//1020hello
        System.out.println("a="+10+",b="+20);//a=10,b=20


    }
    public static void main1(String[] args) {
        boolean flag = true;
        System.out.println(flag);
        //boolean flag2 = 0;
        boolean value = true;
        //System.out.println(value + 1);
        /**
         *         Test.java:4: 错误: 二元运算符 '+' 的操作数类型错误
         *         System.out.println(value + 1);
         *  ^
         *         第一个类型: boolean
         *         第二个类型: int
         *         1 个错误
         */
    }
}
